/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Sep 5, 2011    @time-created 8:17:01 PM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import util.enumeration.Country;
import util.enumeration.Department;
import util.enumeration.Gender;
import util.enumeration.JobPosition;

@Entity(name="Staff")
public class StaffEntity extends PersonEntity implements Serializable {
    private static final long serialVersionUID = 1L;
     
    private Department department;
    private JobPosition jobPosition;
    @Temporal(value = TemporalType.DATE)
    private Date joinDate;
    
    
    public StaffEntity() {
        super();
    }
    
    public void create(String lastName, String firstName, 
                       Gender gender, Date birthdate, 
                       Country country, String locale,
                       String email, String emailSecondary,
                       Department department, JobPosition jobPosition,
                       Date joinDate) {
        super.setLastName(lastName);
        super.setFirstName(firstName);
        super.setGender(gender);
        super.setBirthdate(birthdate);
        super.setCountry(country);
        super.setLocale(locale);
        super.setEmail(email);
        super.setEmailSecondary(emailSecondary);
        this.setDepartment(department);
        this.setJobPosition(jobPosition);
        this.setJoinDate(joinDate);
    }
    
    public void update(Country country, String locale, String email, String emailSecondary, Department department, JobPosition jobPosition) {
        super.setCountry(country);
        super.setLocale(locale);
        super.setEmail(email);
        super.setEmailSecondary(emailSecondary);
        this.setDepartment(department);
        this.setJobPosition(jobPosition);
        this.setJoinDate(joinDate);
    }
    
    public void update(Country country, String locale, String emailSecondary) {
        super.setCountry(country);
        super.setLocale(locale);
        super.setEmailSecondary(emailSecondary);
    }
    
    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public JobPosition getJobPosition() {
        return jobPosition;
    }

    public void setJobPosition(JobPosition jobPosition) {
        this.jobPosition = jobPosition;
    }

    public Date getJoinDate() {
        return joinDate;
    }

    public void setJoinDate(Date joinDate) {
        this.joinDate = joinDate;
    }
    
}
